/ Assembly List / LJCNetCommon / AppSettings / GetColor

Namespace - LJCNetCommon


Parameters
keyName - The setting key name.
defaultColor - The default color.

Returns

The Color setting value.

Syntax

C#
public Color GetColor(String keyName, Color defaultColor)

Gets the Color value of the specified setting. (E)

Remarks

Returns the default color if the config file key is not found.

Example

C#
// App.Config file.
// <configuration>
//   <appSettings>
//     <add key="BeginColor" value="AliceBlue" />
//   </appSettings>
// </configuration>

using System.Drawing;
using LJCNetCommon;

var appSettings = new AppSettings("AppName.exe.config");
Color beginColor = appSettings.GetColor("BeginColor", Color.AliceBlue);

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.